/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hieu.sms.model;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 
 * @author do_th
 */
@Entity
@Table(name = "student_course")
@NamedQueries({
		@NamedQuery(name = "StudentCourse.findAll", query = "SELECT s FROM StudentCourse s"),
		@NamedQuery(name = "StudentCourse.findById", query = "SELECT s FROM StudentCourse s WHERE s.id = :id"),
		@NamedQuery(name = "StudentCourse.findByStudentId", query = "SELECT s FROM StudentCourse s WHERE s.studentId = :studentId"),
		@NamedQuery(name = "StudentCourse.findByCourseId", query = "SELECT s FROM StudentCourse s WHERE s.courseId = :courseId"),
		@NamedQuery(name = "StudentCourse.findByDepId", query = "SELECT s FROM StudentCourse s WHERE s.depId = :depId"),
		@NamedQuery(name = "StudentCourse.findByTeacherId", query = "SELECT s FROM StudentCourse s WHERE s.teacherId = :teacherId"),
		@NamedQuery(name = "StudentCourse.findBySemester", query = "SELECT s FROM StudentCourse s WHERE s.semester = :semester"),
		@NamedQuery(name = "StudentCourse.findByYearSemester", query = "SELECT s FROM StudentCourse s WHERE s.yearSemester = :yearSemester"),
		@NamedQuery(name = "StudentCourse.findByTypeSemester", query = "SELECT s FROM StudentCourse s WHERE s.typeSemester = :typeSemester"),
		@NamedQuery(name = "StudentCourse.findByRegisterDate", query = "SELECT s FROM StudentCourse s WHERE s.registerDate = :registerDate"),
		@NamedQuery(name = "StudentCourse.findByRegisterModify", query = "SELECT s FROM StudentCourse s WHERE s.registerModify = :registerModify"),
		@NamedQuery(name = "StudentCourse.findByMidTestScore", query = "SELECT s FROM StudentCourse s WHERE s.midTestScore = :midTestScore"),
		@NamedQuery(name = "StudentCourse.findByEssaysScore", query = "SELECT s FROM StudentCourse s WHERE s.essaysScore = :essaysScore"),
		@NamedQuery(name = "StudentCourse.findByFinalTestScore", query = "SELECT s FROM StudentCourse s WHERE s.finalTestScore = :finalTestScore"),
		@NamedQuery(name = "StudentCourse.findByFinalScore", query = "SELECT s FROM StudentCourse s WHERE s.finalScore = :finalScore") })
public class StudentCourse extends AbstractPersistentEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id", updatable = false)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "StudentCourseSequence")
	@SequenceGenerator(name = "StudentCourseSequence", sequenceName = "seq_student_course", allocationSize = 1)
	private Long id;
	@Basic(optional = false)
	@Column(name = "student_id")
	private String studentId;
	@Basic(optional = false)
	@Column(name = "course_id")
	private String courseId;
	@Basic(optional = false)
	@Column(name = "dep_id")
	private String depId;	

	@Column(name = "teacher_id")
	private String teacherId;
	@Basic(optional = false)
	@Column(name = "semester")
	private int semester;
	@Basic(optional = false)
	@Column(name = "year_semester")
	private int yearSemester;
	@Column(name = "type_semester")
	private String typeSemester;
	@Column(name = "register_date")
	@Temporal(TemporalType.DATE)
	private Date registerDate;
	@Column(name = "register_modify")
	private Boolean registerModify;
	// @Max(value=?) @Min(value=?)//if you know range of your decimal fields
	// consider using these annotations to enforce field validation
	@Column(name = "mid_test_score")
	private Float midTestScore;
	@Column(name = "essays_score")
	private Float essaysScore;
	@Column(name = "final_test_score")
	private Float finalTestScore;
	@Column(name = "final_score")
	private Float finalScore;

	public StudentCourse() {
	}

	public StudentCourse(Long id) {
		this.id = id;
	}

	public StudentCourse(Long id, String studentId, String courseId,
			String depId, int semester, int yearSemester) {
		this.id = id;
		this.studentId = studentId;
		this.courseId = courseId;
		this.depId = depId;
		this.semester = semester;
		this.yearSemester = yearSemester;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getStudentId() {
		return studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

	public String getCourseId() {
		return courseId;
	}

	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}

	public String getDepId() {
		return depId;
	}

	public void setDepId(String depId) {
		this.depId = depId;
	}

	public String getTeacherId() {
		return teacherId;
	}

	public void setTeacherId(String teacherId) {
		this.teacherId = teacherId;
	}

	public int getSemester() {
		return semester;
	}

	public void setSemester(int semester) {
		this.semester = semester;
	}

	public int getYearSemester() {
		return yearSemester;
	}

	public void setYearSemester(int yearSemester) {
		this.yearSemester = yearSemester;
	}

	public String getTypeSemester() {
		return typeSemester;
	}

	public void setTypeSemester(String typeSemester) {
		this.typeSemester = typeSemester;
	}

	public Date getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	public Boolean getRegisterModify() {
		return registerModify;
	}

	public void setRegisterModify(Boolean registerModify) {
		this.registerModify = registerModify;
	}

	public Float getMidTestScore() {
		return midTestScore;
	}

	public void setMidTestScore(Float midTestScore) {
		this.midTestScore = midTestScore;
	}

	public Float getEssaysScore() {
		return essaysScore;
	}

	public void setEssaysScore(Float essaysScore) {
		this.essaysScore = essaysScore;
	}

	public Float getFinalTestScore() {
		return finalTestScore;
	}

	public void setFinalTestScore(Float finalTestScore) {
		this.finalTestScore = finalTestScore;
	}

	public Float getFinalScore() {
		return finalScore;
	}

	public void setFinalScore(Float finalScore) {
		this.finalScore = finalScore;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof StudentCourse)) {
			return false;
		}
		StudentCourse other = (StudentCourse) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "com.hieu.sms.model.StudentCourse[ id=" + id + " ]";
	}

}
